#include <iostream>
#include <algorithm>
#include <unordered_set>
#include <unordered_map>
using namespace std;
typedef long long ll;
int n, l, r;
string s;
int sum;
ll find(int x)
{
    if(x==0) return 0;
    int hash[26]={0},kinds=0;
    int left=0,right=0;
    ll ret=0;
    while(right<n)
    {
        if(hash[s[right]-'a']++ == 0) kinds++;
        while(kinds>x)
        {
            if(hash[s[left]-'a']-- == 1) kinds--;
            left++;
        }
        ret+=right-left+1;
        ++right;
    }
    return ret;
}
int main() {
    cin >> n >> l >> r;
    cin >> s;
    cout << find(r) - find(l-1) << endl;
    return 0;
}